<extend name="Public/base"/>
<block name="content">
<h3 class="col-md-12">网站设置</h3>
<div class="row">
	<div class="col-md-12">
		<div class="panel panel-default">
			<div class="panel-heading">
				<ul class="nav nav-pills">
			   		<volist name="Think.config.CONFIG_GROUP_LIST" id="group">
					<li><a href="<{:U('group?id='.$key)}>"><{$group}>配置</a></li>
					</volist>
					<li><a href="<{:U('updrive')}>">驱动配置</a></li>
					<li class="active"><a href="<{:U('view')}>">视图配置</a></li>				
				</ul>
			</div>
		
			<div class="panel-body">										
				<ul class="nav nav-tabs">
                   <li class=""><a data-toggle="tab" href="#theme">主题设置</a> </li>
                   <li class="active"><a data-toggle="tab" href="#Home">Home 模块设置</a></li>
                   <li class=""><a data-toggle="tab" href="#User">User 模块设置</a></li>
                   <li class=""><a data-toggle="tab" href="#upyun">预留位置</a></li>
                </ul>
               	<div class="tab-content mt-lg">
                   	<div class="tab-pane fade" id="theme">
						<div class="row">
							<volist name="list" id="vo">
			               	<div class="col-md-3">
			                  	<!-- START panel-->
			                  	<div class="panel panel-default">
			                     	<div class="panel-heading">
			                     		<em class="fa fa-credit-card text-info"></em> 
			                     		<a href="<{$vo['url']}>"><{$vo['name']}> </a>
			              				<eq name="theme_name" value="$vo['id']">
			                     		<a href="#" class="pull-right  hover" data-original-title="默认主题"data-placement="left" data-toggle="tooltip"><em class="fa fa-check-square-o  pull-right text-green"></em></a>
			                     		<else/>
			                     		<a href="#" class="pull-right  hover" data-original-title="删除主题"data-placement="left" data-toggle="tooltip"><em class="fa fa-times-circle text-pink"></em></a>			                     			
			                     		</eq>				                     		 
			                     	</div>
			                    	<div class="panel-body">
			                    		<div class="col-masonry">
						                  <img class="img-thumbnail img-responsive" width="100%" height="167px" src="<{$vo['cover']}>">
						               </div>
			                     	</div>
			                     	<div class="panel-footer clearfix">
				                    	<div class="btn-group pull-left previous">
					                        <button data-toggle="dropdown" data-play="rotateInUpRight" class="btn btn-default btn-sm dropdown-toggle">作者 <b class="caret"></b>
					                        </button>
					                        <ul class="dropdown-menu">
					                           <li><a href="<{$vo['author_url']}>" target="_blank"><{$vo['author']}></a></li>
					                           <li><a href="#">QQ：<{$vo['author_qq']}></a></li>
					                           <li><a href="#">邮箱：<{$vo['author_email']}></a></li>
					                        </ul>
					                    </div>
					                    <eq name="theme_name" value="$vo['id']">
					                	<div class="pull-right pagination p0">
					                		<li class="previous disabled">
					                        <a class="btn btn-default btn-sm btn-success"  href="javascript:;">
					                           <small>启用</small>
					                        </a>
					                    	</li>
					                    </div>
					                    <else/> 
					                    <div class="pull-right">
					                        <a class="btn btn-default btn-sm btn-success using-theme" href="<{:U('view',array('theme'=>$vo['id']))}>">
					                           <small>启用</small>
					                        </a>
					                    </div>
					                    </eq>

				                    </div>
			                  	</div>
			               	</div>
			               	</volist>
			            </div>
              		</div>
                	<div class="tab-pane fade active in" id="Home">
                		<form class="form-horizontal home-form" action="<{:U('homemodule')}>"  method="post">
							<div class="form-group">											
								<label class="col-sm-2 control-label">URL访问模式</label>							
								<div class="col-sm-2">
									<select style="width:auto" class="form-control" name="URL_MODEL">
										<option value="0" <eq name="home_conf['URL_MODEL']" value="0">selected</eq> >普通模式</option>
										<option value="1">PATHINFO 模式</option>
										<option value="2" <eq name="home_conf['URL_MODEL']" value="2">selected</eq> >REWRITE  模式</option>
										<option value="3" <eq name="home_conf['URL_MODEL']" value="3">selected</eq> >兼容模式</option>		
									</select>
								</div>
								<span class="help-inline">REWRITE 重写模式，确保对应服务器规则文件</span>					
							</div>
							
							<div class="form-group">											
								<label class="col-sm-2 control-label">静态缓存</label>							
								<div class="col-sm-2">
									<select style="width:auto" class="form-control" name="HTML_CACHE_ON">
										<option value="0">关闭</option>
										<option value="1" <eq name="home_conf['HTML_CACHE_ON']" value="1">selected</eq> >开启</option>	
									</select>
								</div>
								<span class="help-inline">此功能配合规则可以达到静态网页功能，需要更多储存空间</span>					
							</div>
							
							<div class="form-group">											
								<label class="col-sm-2 control-label">缓存有效期</label>							
								<div class="col-sm-2">
									<input type="text" class="form-control" name="HTML_CACHE_TIME" value="<{$home_conf['HTML_CACHE_TIME']}>">
								</div>
								<span class="help-inline">更新缓存间隔时间，单位-秒</span>						
							</div>
							
							<div class="form-group">											
								<label class="col-sm-2 control-label">缓存文件后缀</label>							
								<div class="col-sm-1">
									<input type="text" class="form-control" name="HTML_FILE_SUFFIX" value="<{$home_conf['HTML_FILE_SUFFIX']}>">
								</div>
								
								<span class="help-inline">缓存文件的文件后缀.html或者.shtml</span>							
							</div>							
							
							<div class="form-group">											
								<label class="col-sm-2 control-label">页面调试信息</label>							
								<div class="col-sm-2">
									<select style="width:auto" class="form-control" name="SHOW_PAGE_TRACE">
										<option value="0">关闭</option>
										<option value="1" <eq name="home_conf['SHOW_PAGE_TRACE']" value="1">selected</eq> >开启</option>	
									</select>
								</div>
								<span class="help-inline">显示页面调试信息</span>					
							</div>
							<hr>
							<div class="form-group">      		
			            		<div class="col-sm-4 col-sm-offset-2">
			                		<button class="btn btn-default" type="button" onclick="javascript:history.back(-1);return false;">取消</button>
			                		<button class="btn btn-primary ajax-post" target-form="home-form" type="submit">保存</button>
			            		</div>
		        			</div>					
							
						</form>	
                	</div>
                	<div class="tab-pane fade" id="User">
                		<form class="form-horizontal user-form" action="<{:U('usermodule')}>"  method="post">
							<div class="form-group">											
								<label class="col-sm-2 control-label">URL访问模式</label>							
								<div class="col-sm-2">
									<select style="width:auto" class="form-control" name="URL_MODEL">
										<option value="0" <eq name="user_conf['URL_MODEL']" value="0">selected</eq> >普通模式</option>
										<option value="1">PATHINFO 模式</option>
										<option value="2" <eq name="user_conf['URL_MODEL']" value="2">selected</eq> >REWRITE  模式</option>
										<option value="3" <eq name="user_conf['URL_MODEL']" value="3">selected</eq> >兼容模式</option>		
									</select>
								</div>
								<span class="help-inline">REWRITE 重写模式，确保对应服务器规则文件</span>				
							</div>
							
							<!--div class="form-group">											
								<label class="col-sm-2 control-label">静态缓存</label>							
								<div class="col-sm-2">
									<select style="width:auto" class="form-control" name="HTML_CACHE_ON">
										<option value="0">关闭</option>
										<option value="1" <eq name="user_conf['HTML_CACHE_ON']" value="1">selected</eq> >开启</option>	
									</select>
								</div>
								<span class="help-inline">此功能可以达到静态网页功能，需要更多空间</span>					
							</div>
							
							<div class="form-group">											
								<label class="col-sm-2 control-label">缓存有效期</label>							
								<div class="col-sm-2">
									<input type="text" class="form-control" name="HTML_CACHE_TIME" value="<{$user_conf['HTML_CACHE_TIME']}>">
								</div>
								<span class="help-inline">更新缓存间隔时间，单位-秒</span>						
							</div>
							
							<div class="form-group">											
								<label class="col-sm-2 control-label">缓存文件后缀</label>							
								<div class="col-sm-1">
									<input type="text" class="form-control" name="HTML_FILE_SUFFIX" value="<{$user_conf['HTML_FILE_SUFFIX']}>">
								</div>
								
								<span class="help-inline">缓存文件的文件后缀.html或者.shtml</span>							
							</div-->							
							
							<div class="form-group">											
								<label class="col-sm-2 control-label">页面调试信息</label>							
								<div class="col-sm-2">
									<select style="width:auto" class="form-control" name="SHOW_PAGE_TRACE">
										<option value="0">关闭</option>
										<option value="1" <eq name="user_conf['SHOW_PAGE_TRACE']" value="1">selected</eq> >开启</option>	
									</select>
								</div>
								<span class="help-inline">显示页面调试信息</span>					
							</div>
							<hr>
							<div class="form-group">      		
			            		<div class="col-sm-4 col-sm-offset-2">
			                		<button class="btn btn-default" type="button" onclick="javascript:history.back(-1);return false;">取消</button>
			                		<button class="btn btn-primary ajax-post" target-form="user-form" type="submit">保存</button>
			            		</div>
		        			</div>					
						</form>	
                	</div>

                	<div class="tab-pane fade " id="upyun">
						<div class="form-group">      		
		            		<div class="col-sm-4 col-sm-offset-2">
		                		<button class="btn btn-default" type="button" onclick="javascript:history.back(-1);return false;">取消</button>
		                		<button class="btn btn-primary ajax-post" target-form="form-horizontal" type="submit">保存</button>
		            		</div>
	        			</div>

                	</div>	                
        		</div>			
				
			</div>		
		</div>
	</div>
</div>
</block>
<block name="script">
<script type="text/javascript">
//导航高亮
highlight_subnav("<{:U('Config/group')}>");
$('.using-theme').click(function () {
	var url = $(this).attr('href');
	$.post(url, function(data){
   		if (data.status == 1){
            topAlert(data.info + ' 页面即将自动跳转~','success');
            setTimeout(function(){
                if (data.url) {
                    location.href=data.url;
                }else{
                    location.reload();
                }
            },1500);
   		}else{
   			topAlert(data.info);
   		}   		
	});
	return false;
});
</script>
</block>	

